.\" Man page generated from reStructeredText.
.
.TH BUILD UCORE  "" "1" ""
.SH NAME
Build Ucore \- 
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
This document discusses how to build ucore for different architectures and makefiles used.
.SS Contents
.INDENT 0.0
.IP \(bu 2
.
\fI\%Building Ucore\fP
.IP \(bu 2
.
\fI\%Makefile Layout\fP
.IP \(bu 2
.
\fI\%Variables\fP
.IP \(bu 2
.
\fI\%Targets\fP
.IP \(bu 2
.
\fI\%References\fP
.UNINDENT
.SH BUILDING UCORE
.sp
To build ucore for x86_64 and simulate the kernel, simply type
.INDENT 0.0
.INDENT 3.5
.sp
make ARCH=x86_64
.sp
make qemu
.UNINDENT
.UNINDENT
.sp
All dependencies, objects, executables and images will be created under obj.
.SH MAKEFILE LAYOUT
.sp
Makefiles used at present are derived from ucore\-mp64 project [1]. They include:
.INDENT 0.0
.IP \(bu 2
.
top level makefiles
.INDENT 2.0
.IP \(bu 2
.
one main makefile (Makefile)
.IP \(bu 2
.
compilation\-related variables (mk/comp*.mk)
.IP \(bu 2
.
architecture\-related configs (mk/config\-*.mk)
.IP \(bu 2
.
architecture\-based building targets (mk/arch\-*.mk)
.UNINDENT
.IP \(bu 2
.
per\-module makefiles
.INDENT 2.0
.IP \(bu 2
.
one main makefile (src/$MODULE/Makefile)
.IP \(bu 2
.
architecture\-dependent variables and targets (src/$MODULE/arch/$ARCH/*.mk)
.UNINDENT
.UNINDENT
.SH VARIABLES
.INDENT 0.0
.TP
.B ARCH
.
What architecture \fBucore\fP is built for. Possible choices include \fBi386\fP, \fBx86_64\fP, \fBor32\fP and \fBum\fP.
.TP
.B HOST_CC_PREFIX
.
Prefix of compiler, assembler etc. for building host tools. Default to empty in all architectures.
.TP
.B TARGET_CC_PREFIX
.
Prefix of compiler, assembler etc. for buildiing ucore. Default to empty in i386 and um, "x86_64\-elf\-" in x86_64 and "or32\-elf\-" in or32.
.UNINDENT
.SH TARGETS
.INDENT 0.0
.TP
.B mod\-$MODULE
.
For each module needed, there exists a target named mod\-$MODULE which simply print a few information and invoke the module\(aqs makefile.
.TP
.B clean
.
Cleans everything under directory obj.
.TP
.B qemu
.
Simulate the kernel using qemu. Available when \fBARCH\fP is i386 or x86_64.
.TP
.B run
.
Execute the kernel directly or using a simulator other than qemu. Available when \fBARCH\fP is um or or32.
.TP
.B others
.
Extra targets can also be defined in order to create images or do anything else.
.UNINDENT
.SH REFERENCES
.IP [1] 5
.
\fI\%https://github.com/xinhaoyuan/ucore\-mp64\fP
.SH AUTHOR
Mao Junjie <eternal.n08@gmail.com>
.\" Generated by docutils manpage writer.
.\" 
.
